package com.example.sprinbootdemo.service.impl;

import com.example.sprinbootdemo.entity.Owner;
import com.example.sprinbootdemo.mapper.OwnerMapper;
import com.example.sprinbootdemo.service.OwnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;


@Service
public class OwnerServiceImpl implements OwnerService {
    @Autowired
    private OwnerMapper ownerMapper;

    @Override
    public List<Owner> getAllOwners() {
        return ownerMapper.selectAll();
    }

    @Override
    public void addOwner(Owner owner) {
        ownerMapper.addOwner(owner);
    }

    @Override
    public void deleteOwnerById(int ownerId) {
        ownerMapper.deleteOwnerById(ownerId);
    }
    @Override
    public void updateOwnerById(Owner owner) {
        ownerMapper.updateOwnerById(owner);
    }

    @Override
    public List<Owner> getOwnersByName(String name) {
        return ownerMapper.getOwnerByName(name);
    }
}